package com.haizhi.crm.sys.auth.dao;

import com.haizhi.crm.sys.auth.model.UserRoleDo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by yangyijun on 2018/5/29.
 */
@Transactional
@Repository
public interface UserRoleDao extends JpaRepository<UserRoleDo, Long> {
    List<UserRoleDo> findByUserId(@Param("userId" ) Long userId);

    List<UserRoleDo> findByUserIdAndRoleId(@Param("userId" ) Long userId, @Param("roleId" ) Long roleId);
}
